package com.dpl.yyrj.ui.imageChoose;

import java.util.ArrayList;
import java.util.List;

import android.os.Parcel;
import android.os.Parcelable;


public class Album implements Parcelable {

	String name;
	long buckId;
	int photoSize = 0;
	List<String> photos;
	
	public List<String> getPhotos(){
		return photos;
	}
	
	public void addPhoto(String photo){
		if (photos == null) {
			photos = new ArrayList<String>();
		}
		photos.add(photo);
		photoSize++;
	}
	

	public String getName() {
		return name;
	}
	
	public int getSize() {
		return photoSize;
	}

	public void setName(String name) {
		this.name = name;
	}

	
	public long getBuckId() {
		return buckId;
	}

	public void setBuckId(long buckId) {
		this.buckId = buckId;
	}

	public Album() {
		// TODO Auto-generated constructor stub
	}
	public Album(Parcel parcel){
		name = parcel.readString();
		buckId = parcel.readLong();
		photoSize = parcel.readInt();
		photos = parcel.readArrayList(Album.class.getClassLoader());
	}

	@Override
	public int describeContents() {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		// TODO Auto-generated method stub
		dest.writeString(name);
		dest.writeLong(buckId);
		dest.writeInt(photoSize);
		dest.writeList(photos);
	}

	public static final Creator<Album> CREATOR = new Creator<Album>() {

		@Override
		public Album createFromParcel(Parcel source) {
			// TODO Auto-generated method stub
			return new Album(source);
		}

		@Override
		public Album[] newArray(int size) {
			// TODO Auto-generated method stub
			return new Album[size];
		}
	};

}
